<?php

namespace App\Services\User;

use Hashids\Hashids;

class UserHashidService
{
    const HASHID_SALT = 'ZED';

    const HASHID_LENGTH = 7;

    /**
     * @param string $userId
     * @return string
     */
    public static function encode(string $userId): string
    {
        $hashids = new Hashids(self::HASHID_SALT, self::HASHID_LENGTH);

        return $hashids->encode($userId);
    }
}
